home *** CD-ROM | disk | FTP | other *** search
/ IRIX 6.4 Applications 1997 August / SGI IRIX 6.4 Applications 1997 August.iso / dist / mmailp.idb / usr / lib / Zmail / bin / xwrap-sec.z / xwrap-sec
Encoding:
Text File  |  1997-01-22  |  2.1 KB  |  67 lines

  1. :
  2. # Wrapper script for starting X11 attachment viewer/editor utilities
  3. # Parts of this script require translation for non-English languages
  4. #
  5. # This file Copyright (c) 1992-94 Z-Code Software, a Division of NCD.
  6. # Permission to use, copy, modify, and distribute this material
  7. # for any purpose and without fee is hereby granted, provided
  8. # that the above copyright notice and this permission notice
  9. # appear in all copies, and that the name of Z-Code Software not
  10. # be used in advertising or publicity pertaining to this
  11. # material without the specific, prior written permission
  12. # of an authorized representative of Z-Code.  Z-CODE SOFTWARE
  13. # MAKES NO REPRESENTATIONS ABOUT THE ACCURACY OR SUITABILITY
  14. # OF THIS MATERIAL FOR ANY PURPOSE.  IT IS PROVIDED "AS IS",
  15. # WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES.
  16.  
  17. ttyinput=false
  18. ttyoutput=true
  19.  
  20. # Look for a tty in the obvious places
  21. if test -t 0
  22. then
  23.     ttyinput=true
  24. fi
  25. if test -t 2
  26. then
  27.     exec 3>/dev/null
  28.     exec 2>&3
  29. elif test -t 1
  30. then
  31.     exec 3>/dev/null
  32.     exec 1>&3
  33. elif $ttyinput
  34. then
  35.     exec 3>/dev/null
  36.     exec 0>&3
  37. else
  38.     ttyoutput=false
  39. fi
  40.  
  41. # See if the DISPLAY veriable is set
  42. if test -z "$DISPLAY"
  43. then
  44.     if $ttyoutput
  45.     then
  46.     exec 3>&1
  47.     echo ""
  48.     echo This message part contains data which can currently be viewed
  49.     echo only when running X11.  If you read this message while running
  50.     echo X11, and have your DISPLAY variable set, you will then be able
  51.     echo to view the message part properly.
  52.     echo ""
  53.     fi
  54.     exit 1
  55. fi
  56.  
  57. # Everything looks OK -- run the argument list as a command
  58. if [ "`whoami`" = "root" ]; then
  59.     xconfirm -t "This attachment type can contain embedded commands. Therefore," -t "as a security precaution, MediaMail will not display this attachment" -t "when MediaMail is launched by the super user." -header MediaMail -icon warning -b OK -c 1>/dev/null
  60. else
  61.     case `xconfirm -t "This attachment type can contain embedded commands. Therefore," -t "displaying this attachment may enable a breach in the security" -t "of your system.  Display anyway?" -header MediaMail -icon warning -b No -b Yes -c`
  62.     in
  63.         Yes) exec "$@";;
  64.         No)  exit 0;;
  65.     esac
  66. fi
  67.